package com.example.liwushuo.adapter;

import java.util.List;

import com.example.liwushuo.bean.Candidate;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

public class TallAdapter extends FragmentPagerAdapter {

	String[] titles;

	private List<Fragment> list;

	public TallAdapter(FragmentManager fm, List<Fragment> list, String[] titles) {
		super(fm);
		this.list = list;
		this.titles = titles;
	}

	@Override
	public Fragment getItem(int arg0) {
		return list.get(arg0);
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return titles != null && titles.length > 0 ? titles[position] : super
				.getPageTitle(position);
	}

}
